<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('菜单管理')" />
</head>
<body>
<div class="wrapper">
    <form role="form" style="font-size: 12px" id="form" th:object="${user}">
        <input type="hidden" th:field="*{userId}">
        <div class="box-body">
            <div class="form-group">
                <label>登录名称</label>
                <input type="text" class="form-control input-sm" th:field="*{username}" readonly="true">
            </div>
            <div class="form-group">
                <label>新密码</label>
                <input type="password" class="form-control input-sm" name="password">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = "/system/user";
    $(function() {
    });
    $("#form").validate({
        rules:{
            password: {
                required: true,
                minlength: 5,
                maxlength: 20
            }
        },
        messages: {
            password: {
                required: "请输入新密码",
                minlength: "密码不能小于6个字符",
                maxlength: "密码不能大于20个字符"
            }
        },
        focusCleanup: true
    });
    function submitHandler() {
        if ($.validate.form()) {
            var json = $.common.formToJSON('form');
            $.operate.save(prefix + '/resetPwd', json);
        }
    }
</script>
</body>
</html>
